{extend name="layout_modal" /}
{block name="content"}
<!-- Content Header (Page header) -->
<section class="content" style="padding-top:0px;">
<div class="row">
  <div class="box">
    <!-- /.box-header -->
    <!-- form start -->
    <form role="form" action="{:url('data_save')}">
      <div class="box-body">
        <div class="form-group">
          <label for="exampleInputEmail1">账号类型</label>
          <input type="text" class="form-control" placeholder="账号类型" value="{$authgroup.6.title}" readonly>
        </div>
        <div class="form-group">
          <label for="exampleInputEmail1">全称</label>
          <input type="text" class="form-control" placeholder="用户名" name="fullname">
        </div>
        <div class="form-group">
          <label for="exampleInputEmail1">简称</label>
          <input type="text" class="form-control" placeholder="用户名" name="realname">
        </div>
        <div class="form-group">
          <label for="exampleInputEmail1">用户名</label>
          <input type="text" class="form-control" placeholder="用户名" name="username">
        </div>
        <div class="form-group">
          <label for="exampleInputEmail1">密码</label>
          <input type="password" class="form-control" placeholder="密码" name="password">
        </div>
        <div class="form-group">
          <label for="exampleInputEmail1">手机号</label>
          <input type="text" class="form-control" placeholder="手机号" name="phone">
        </div>
        <div class="form-group">
          <label for="exampleInputEmail1">邮箱</label>
          <input type="text" class="form-control" placeholder="邮箱" name="email">
        </div>
        <div class="form-group">
          <label for="exampleInputEmail1">省份</label>
          <select class="form-control" name="province_code" onchange="get_city(this,this.value)">
            <option value="">选择省份</option>
            {volist name=":get_model_func('City', 'list_datad', ['pid'=>1], 1, 40, true, 'id asc')" id="v"}
            <option value="{$v.code}">{$v.title}</option>
            {/volist}
          </select>
        </div>
        <div class="form-group">
          <label for="exampleInputEmail1">城市</label>
          <select class="form-control" name="city_code" id="city">
            <option value="">选择城市</option>
          </select>
        </div>
      </div>
      <input type="hidden" name="roleid" value="6">
      <!-- /.box-body -->
    </form>
  </div>
</div>
</section>
<!-- /.content -->
{/block}
{block name="script"}
<script type="text/javascript">
function get_city (obj, value) {
  $.post("{:url('city/get_city')}",{  code:value},function(datajson){
    if (!datajson) {
      return false;
    };
    var html = '<option value="">选择城市</option>';
    $.each(datajson, function(index, item) {
      html += '<option value="'+item.code+'">'+item.title+'</option>';
    });
    $('#city').html('');
    $('#city').append(html);
  }); 
}
</script>
{/block}